package gamagora.game.map.parts
{
	import gamagora.box2d.OSPhysicBridge;
	import gamagora.box2d.OSPhysicCircle;
	import gamagora.box2d.OSPhysicData;
	import gamagora.box2d.OSPhysicSprite;
	import gamagora.box2d.OSPhysicWaterBridge;
	import gamagora.game.OSBoxBridge;
	import gamagora.game.OSCircleBridge;
	import gamagora.game.OSFireWall;
	import gamagora.game.OSStall;
	import gamagora.game.OSWall;
	import gamagora.game.OSWaterGenerator;
	import gamagora.game.animations.OSAnimation;
	import gamagora.game.animations.OSBird;
	import gamagora.game.animations.OSMonkey;
	import gamagora.game.animations.OSMonkeyCage;
	import gamagora.game.map.OSLayer;
	import gamagora.game.map.OSMap;
	import gamagora.game.utils.OSImages;
	
	import org.flixel.FlxBasic;
	import org.flixel.FlxSprite;
	
	public class OSMap1 extends OSMap
	{
		public function OSMap1()
		{
			super(0);
		}
		
		protected override function create():void
		{
			//Background
			/*var monkey:OSMonkey = new OSMonkey(400, 120, OSAnimation.BACKGROUND3);
			monkey.moveTo(600);
			_backgrounds.add(monkey);
			_backgrounds.add(new OSBird(1270, 130, OSAnimation.BACKGROUND3, true));
			_backgrounds.add(new OSBird(1300, 150, OSAnimation.BACKGROUND3, true));
			_backgrounds.add(new OSBird(1270, 160, OSAnimation.BACKGROUND3, true));
			_backgrounds.add(new OSMonkeyCage(780, 150));
			*/
			//In Game
			_objects.push(new OSWall(-5, 0, 5, 540)); // Mur gauche invisible
			_objects.push(new OSWall(0, 540, 134, 5)); //Mur bas gauche invisible
			_objects.push(new OSWall(134, 540 - 80, 84, 80)); //Premier bloc
			_objects.push(new OSWall(218, 540 - 160, 84, 160)); //Deuxième bloc
			_objects.push(new OSWall(302, 540 - 240, WIDTH - 302, 240)); //troisième bloc
			_objects.push(new OSWall(512, 540 - 255, 230, 15)); //quatrième bloc
			
			//_objects.push(new OSStall(800, 277, 20, 4));
			
			//_objects.push(new OSFireWall(527, 265, 200, 20));
			
			//Foreground
			_foregrounds.add(new FlxSprite(0, 0, OSImages.N1P1));
			//_foregrounds.add(new OSWaterGenerator(900, 130, 100, 300));
			//_foregrounds.add(new OSBird(344, 300));
		}
	}
	
	//Exemple d'utilisation
	
	/*
	
	//Brige example
	//objects.push(new OSWall(0, 420, WIDTH, 20));
	//objects.push(new OSWall(50, 50, 20, 370, 0, OSPhysicData.WALL));
	//objects.push(new OSWall(470, 50, 20, 370, 0, OSPhysicData.WALL));
	//objects.push(new OSCircleBridge(70, 100, 10, BALL, 20));
	//objects.push(new OSCircleBridge(70, 200, 10, BALL, 20));
	//objects.push(new OSBoxBridge(70, 300, 40, 5));
	
	//Water generator
	objects.push(new OSWall(0, 420, WIDTH, 20));
	objects.push(new OSWall(100, 100, 200, 10, -45, OSPhysicData.WALL));
	objects.push(new OSWaterGenerator(130, 175, 200));
	
	//Water brige
	//objects.push(new OSWall(0, 220, 200, 5));
	//objects.push(new OSWall(800, 220, WIDTH - 800, 5));
	
	//objects.push(new OSWall(200, 220, 5, HEIGHT - 220));
	//objects.push(new OSWall(795, 220, 5, HEIGHT - 220));
	
	//objects.push(new OSWall(0, 0, WIDTH, 5));
	//objects.push(new OSPhysicWaterBridge(205, 240, 10, 9, 50, 10, true));
	
	//Stall
	//objects.push(new OSStall(400, 400, 20, 4));
	
	//Fire ground example
	//objects.push(new OSWall(0, 420, 200, 20));
	//objects.push(new OSFireWall(200, 420, 200, 20));
	//objects.push(new OSWall(400, 420, 100, 20));
	//objects.push(new OSFireWall(500, 420, 200, 20));
	//objects.push(new OSWall(700, 420, WIDTH - 600, 20));
	
	//Map example
	
	//Grounds
	//objects.push(new OSWall(0, 420, 600, 20));
	//objects.push(new OSPhysicBridge(605, 430));
	//objects.push(new OSWall(810, 420, WIDTH - 810, 20));
	
	//Walls
	//objects.push(new OSWall(-20, 0, 20, HEIGHT, 0, OSPhysicData.WALL));
	//objects.push(new OSWall(WIDTH, 0, 20, HEIGHT, 0, OSPhysicData.WALL));
	//objects.push(new OSWall(1100, 250, 20, 100, 45, OSPhysicData.WALL));
	//objects.push(new OSWall(950, 150, 20, 100, 0, OSPhysicData.WALL));
	//objects.push(new OSWall(1100, 50, 20, 100, 0,OSPhysicData.WALL));
	
	//Bounces
	//objects.push(new OSWall(830, 130, 50, 10, 0, OSPhysicData.BOUNCE, true));
	//objects.push(new OSWall(630, 130, 50, 10, 0, OSPhysicData.BOUNCE, true));
	//objects.push(new OSWall(430, 130, 50, 10, 0, OSPhysicData.BOUNCE, true));
	
	//Background
	//var v:OSLayer = new OSLayer();
	//v.add(new FlxSprite(0, 0, BACKGROUND));
	//backgrounds.push(v);
	
	//Foreground
	//v = new OSLayer();
	//v.add(new FlxSprite(400, 170, TREE));
	//foregrounds.push(v);
	
	//objects.push(new OSWall(0, 1100, WIDTH, 20));
	//objects.push(new OSWall(100, 700, 20, 300));
	//objects.push(new OSWall(550, 1050, 50, 10, true));
	//objects.push(new OSWall(350, 700, 20, 300, true));
	//objects.push(new OSWall(450, 700, 20, 300, true));
	
	//objects.push(new OSWall(0, 800, 100, HEIGHT - 800, true));
	//objects.push(new OSWall(100, HEIGHT - 20, 300, 20, true));
	//objects.push(new OSWall(400, 1000, 500, HEIGHT - 1000, true));
	
	//objects.push(new OSPhysicBridge(200, 1000));
	*/
}
